<?php
declare (strict_types=1);

namespace app\api\version\v1;

use app\common\controller\Api;
use app\common\lib\Poster;
use think\facade\Db;

/**
 * | Notes：会员中心
 * +----------------------------------------------------------------------
 * | PHP Version 7.2+
 * +----------------------------------------------------------------------
 * | Copyright (c) 2011-2020 https://www.xxq.com.cn, All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: 和好 <389123492@qq.com>
 * +----------------------------------------------------------------------
 * | Date: 2020/11/3 18:05
 * +----------------------------------------------------------------------
 */
class Config extends Api
{
    use Poster;


    public function initialize()
    {
        parent::initialize(); // TODO: Change the autogenerated stub
    }

    /**
     * @OA\Get(path="/v1/getConfigDetail",
     *   tags={"首页管理"},
     *   summary="根据name获取配置信息",
     *   @OA\Parameter(name="token", in="header", description="token", @OA\Schema(type="string", default="123456")),
     *   @OA\Parameter(name="name", in="query", description="member_deal用户协议    platform_introduction平台介绍    connect_us联系我们    transfer_min提现最小金额  transfer_rate提现手续费", @OA\Schema(type="string", default="member_deal,platform_introduction")),
     *   @OA\Response(
     *      response=200,
     *      description="The Member",
     *      @OA\JsonContent(type="object",
     *          @OA\Property(property="msg", type="string"),
     *          @OA\Property(property="code", type="integer", default="200"),
     *          @OA\Property(property="data", type="object",
     *               @OA\Property(property="list", type="object",description="列表,具体值参考详情"),
     *          ),
     *      ),
     *   ),
     * )
     */
    public function getConfigDetail($name)
    {
        //
        $info = Db::name("config")
            ->field('name,title,value121')
            ->where('name', 'in', $name)
            ->select()
            ->toArray();

        return $this->jsonSuccessData("操作成功", $info);
    }

}